package com.hsteach.service.rota;

import java.util.List;

import com.hsteach.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.hsteach.dao.mapper.rota.RotaFilesMapper;
import com.hsteach.dao.domain.rota.RotaFiles;

/**
 * 值班记录附件Service业务层处理
 * 
 * @author fanxquer
 * @date 2023-10-22
 */
@Service
public class RotaFilesService
{
    @Autowired
    private RotaFilesMapper rotaFilesMapper;

    /**
     * 查询值班记录附件
     * 
     * @param id 值班记录附件主键
     * @return 值班记录附件
     */
    public RotaFiles selectRotaFilesById(Long id)
    {
        return rotaFilesMapper.selectRotaFilesById(id);
    }

    /**
     * 查询值班记录附件列表
     * 
     * @param rotaFiles 值班记录附件
     * @return 值班记录附件
     */
    public List<RotaFiles> selectRotaFilesList(RotaFiles rotaFiles)
    {
        return rotaFilesMapper.selectRotaFilesList(rotaFiles);
    }

    /**
     * 新增值班记录附件
     * 
     * @param rotaFiles 值班记录附件
     * @return 结果
     */
    public int insertRotaFiles(RotaFiles rotaFiles)
    {
        rotaFiles.setCreateTime(DateUtils.getNowDate());
        return rotaFilesMapper.insertRotaFiles(rotaFiles);
    }

    /**
     * 修改值班记录附件
     * 
     * @param rotaFiles 值班记录附件
     * @return 结果
     */
    public int updateRotaFiles(RotaFiles rotaFiles)
    {
        rotaFiles.setUpdateTime(DateUtils.getNowDate());
        return rotaFilesMapper.updateRotaFiles(rotaFiles);
    }

    /**
     * 批量删除值班记录附件
     * 
     * @param ids 需要删除的值班记录附件主键
     * @return 结果
     */
    public int deleteRotaFilesByIds(Long[] ids)
    {
        return rotaFilesMapper.deleteRotaFilesByIds(ids);
    }

    /**
     * 删除值班记录附件信息
     * 
     * @param id 值班记录附件主键
     * @return 结果
     */
    public int deleteRotaFilesById(Long id)
    {
        return rotaFilesMapper.deleteRotaFilesById(id);
    }
}
